package com.ctyun.xstore.vod.vodsetting;

import java.io.IOException;
import com.ctyun.xstore.vod.AbstractVODClient;
import com.ctyun.xstore.vod.vodsetting.model.GetUserVodRegionListRequest;
import com.ctyun.xstore.vod.vodsetting.model.GetUserVodRegionListResponse;
import com.ctyun.xstore.vod.vodsetting.model.SetAclRequest;
import com.ctyun.xstore.vod.vodsetting.model.SetAclResponse;
import com.ctyun.xstore.vod.vodsetting.model.SetRefererRequest;
import com.ctyun.xstore.vod.vodsetting.model.SetRefererResponse;
import com.ctyun.xstore.vod.vodsetting.model.SetUserDefaultVodRegionRequest;
import com.ctyun.xstore.vod.vodsetting.model.SetUserDefaultVodRegionResponse;

public class VodSettingClient extends AbstractVODClient {

	public VodSettingClient(String accessKey, String secretKey) {
		super(accessKey, secretKey);
	}

	public VodSettingClient(String host, String accessKey, String secretKey) {
		super(host, accessKey, secretKey);
	}

	/**
	 * 设置防盗链
	 *
	 * @param request 设置权限的相关参数，包括区域编码
	 * @return 创建模板的结果，包括code与message
	 * @throws IOException 可能会发生 IO 异常。
	 */
	public SetRefererResponse setReferer(SetRefererRequest request)
			throws IOException {
		return this.execute(request, SetRefererResponse.class);
	}

	/**
	 * 设置权限接口
	 *
	 * @param request 设置权限的相关参数，包括区域编码
	 * @return 创建模板的结果，包括code与message
	 * @throws IOException 可能会发生 IO 异常。
	 */
	public SetAclResponse setAcl(SetAclRequest request)
			throws IOException {
		return this.execute(request, SetAclResponse.class);
	}

	/**
	 * 获取点播池信息列表
	 * 
	 * @param request
	 * @return
	 * @throws IOException
	 */
	public GetUserVodRegionListResponse listVodRegion(GetUserVodRegionListRequest request) throws IOException {
		return this.execute(request, GetUserVodRegionListResponse.class);
	}

	/**
	 * 设置用户默认点播资源池接口
	 * 
	 * @param request
	 * @return
	 * @throws IOException
	 */
	public SetUserDefaultVodRegionResponse setUserDefaultVod(SetUserDefaultVodRegionRequest request)
			throws IOException {
		return this.execute(request, SetUserDefaultVodRegionResponse.class);
	}
}
